package sg.edu.nus.iss.jass.dao;

import java.util.ArrayList;
import java.util.List;

import sg.edu.nus.iss.jass.model.SkillDTO;

/**
 * @version 1.0
 * @author SE19 Team 1
 * 
 */
public class SkillDAO extends PropertiesDAO {
	
	public static String pathname = "properties/skills.properties";
	
	// Class Constructor.
	public SkillDAO() {
		super(pathname, SkillDTO.class);
	}
	
	public SkillDTO getSkill(String id) {
		return (SkillDTO)this.getObject(id);
	}
	
	public List<SkillDTO> getSkillList() {
		List<SkillDTO> skills = new ArrayList<SkillDTO>();
		
		for(int n = 0; n < getTotal(); n++) {
			String strId = String.valueOf(n + 1);
			skills.add(getSkill(strId));
		}
		return skills;
	}
}